package plugins.videoPlayer;


import java.awt.GridLayout;
import java.io.File;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

import annotation.Menu;

import interfaces.PluginInterface;

/**
 * Cette classe permet le lancement des fichiers videos de type avi mpg
 * @author Amine HALLILI amine.hallili@gmail.com
 *
 */
public class VideoPlayer implements PluginInterface {

	boolean parDefaut =false;
	
	@Menu(libelle="VideoPlayer")
	@Override
	public JPanel getFrameDetail() {
		JPanel p = new JPanel();
		p.setLayout(new GridLayout(10, 3));
		p.add(new JLabel("Details       : Video Player"));
		p.add(new JLabel("Version     : "+getVersion()));
		StringBuilder extension = new StringBuilder("");
		for(String e : getExtension())
			extension.append(" | "+e);
		p.add(new JLabel("Extension : "+extension));
		if(isDefault())
			p.add(new JLabel("par défaut  : Oui"));
		
		return p;
	}

	@Override
	public String[] getExtension() {
		return new String[]{"avi","mpg","MPG"};
	}

	@Override
	public String getVersion() {
		return "1.0";
	}

	@Override
	public JFrame getFrame(File o) {
		return new PlayVideo(o);
		
	}

	@Override
	public boolean isDefault() {
		
		return parDefaut;
	}

	@Override
	public void setDefault(boolean bool) {
		parDefaut = bool;
		
	}
	
	
	@Override
	public ImageIcon getIcon() {
		return new ImageIcon("../Plugin/bin/plugins/videoPlayer/VideoPlayer.png");
	}

}
